<?php

declare(strict_types=1);

namespace Api\InterfaceApi\v1\Work;

use Api\Request\v1\Work\IdConvertApiRequest;
use Api\Service\v1\Work\IdConvertApiService;
use Hyperf\Di\Annotation\Inject;
use Mine\MineApi;

class IdConvertApi extends MineApi
{

    #[Inject]
    protected IdConvertApiService $service;

    /**
     * unionid与external_userid的关联
     * @param IdConvertApiRequest $request
     * @return \Psr\Http\Message\ResponseInterface
     * @throws \Psr\Container\ContainerExceptionInterface
     * @throws \Psr\Container\NotFoundExceptionInterface
     */
    public function unionidToExternalUserid(IdConvertApiRequest $request): \Psr\Http\Message\ResponseInterface
    {
        return $this->success($this->service->unionidToExternalUserid($request->all()));
    }

    public function externalUseridToPendingId(IdConvertApiRequest $request): \Psr\Http\Message\ResponseInterface
    {
        return $this->success($this->service->externalUseridToPendingId($request->all()));
    }
}